<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>安平一码通</title>
</head>

<body>
    <!-- 页面顺序 login middle user gocode -->
    <script src="./jquery/jquery.min.js"></script>
    <script>
        $.ajax({
            type: "get",
            url: "http://user.city1000.top/wechat/wxScan", //自己填写请求地址
            data: {
                url: window.location.href
            },
            success: function (result) {
                //alert(result.appId)
                var appID = result.appId
                var redirectUri = encodeURI('http://hesuan.city1000.cn/zhanglei/middlecheck.html'); // 授权成功后重定向地址
                var state = "122222|2"; // 状态标识（用于项目拓展)
                // 跳转授权(拿到用户信息)
                var strUrl = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=" + appID +
                    "&redirect_uri=" + redirectUri +
                    "&response_type=code&scope=snsapi_base&state=" + state + "#wechat_redirect";
                window.location.href = strUrl;
            }
        })
    </script>
</body>

</html>